const fs = require("fs");

let rs = fs.createReadStream('3rd.png');
let ws = fs.createWriteStream('2rd.png');

//创建管道，将读取流通过管道流出
rs.pipe(ws);